const puppeteer = require('puppeteer');
(async ()=> {
    /* 1.新建一个浏览器的实例 */
    const browser = await puppeteer.launch({
        headless:false,
        defaultViewport:null
    });
    /* 2.新建一个页面 */
    const page = await browser.newPage();
    /* 3.到达某个页面 */
    await page.goto('https://www.baidu.com');
    var input = await page.$("#kw");
    await input.type("hello world");
    var btn = await page.$("#su");
    await btn.click();
    var content = await page.$eval("#su",ele=>ele.value)
    console.log(content)
    await page.waitForTimeout(3000)
})();